﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ServiceInterfaces.DataContracts;

namespace MINERP.StartOrder.Forms
{
    public partial class FrmSelectShop : Form
    {
        public FrmSelectShop()
        {
            InitializeComponent();
        }
       public  List<ShopInfo_Order> UnSelectShop = new List<ShopInfo_Order>();
       public ShopInfo_Order SelectShop = new ShopInfo_Order();

       private void FrmSelectShop_Load(object sender, EventArgs e)
       {
           if (UnSelectShop.Count > 0)
           {
               foreach (ShopInfo_Order so in UnSelectShop)
               {
                   listBoxShopName.Items.Add(so.ShopName);
               }
 
           }
       }

       private void listBoxShopName_DoubleClick(object sender, EventArgs e)
       {
           string shopName = listBoxShopName.SelectedItem.ToString();
           SelectShop = UnSelectShop.FirstOrDefault(sh => sh.ShopName.Equals(shopName));
           this.DialogResult = DialogResult.OK;
       }
    }
}
